package com.shop.service.user;

import com.shop.pajo.Book;
import com.shop.pajo.LoginTicket;
import com.shop.pajo.ShoppingCart;
import com.shop.pajo.User;

import java.util.List;
import java.util.Map;

public interface UserService {

    Map<String, Object> login(String username, String password, int expiredSeconds);

    //通过cookie键的值查找到user对象
    LoginTicket getLoginTicketByTicket(String ticket);

    User getUserById(int id);

    User getUserByName(String username);

    //注销
    int logout(String ticket);

    //注册
    Map<String, Object> register(User user);

    //添加图书到购物车
    Map<String, Object> addToCart(ShoppingCart shoppingCart);

    //查看购物车
    List<Book> getCart(int uid);

    //删除购物车
    int deleteCart(String bid);
}
